package com.datasource.service.impl;

import com.datasource.dao.UserMapper;
import com.datasource.db.ContextConst;
import com.datasource.db.DataSource;
import com.datasource.model.User;
import com.datasource.service.IUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author fyy
 * @Description
 * @Date 2020/6/4 9:47
 */
@Service
public class UserService implements IUserService {

    @Resource
    private UserMapper userMapper;

    @Override
    @DataSource(value = ContextConst.DataSourceType.LOCAL)
    public List<User> getAll() {
        return userMapper.selectAll();
    }
}
